package com.wanchuang.qhbb.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wanchuang.qhbb.R;
import com.wanchuang.qhbb.proto.Recharge;

public class AccountNewAdapter extends BaseQuickAdapter<Recharge.My_earnings.wallet_list, BaseViewHolder> {
    private int[] bgColors = {R.mipmap.account_4, R.mipmap.account_5};
    private int[] qianBg = {R.mipmap.account_7, R.mipmap.account_6};

    public AccountNewAdapter(Context context) {
        super(R.layout.item_account_new);
    }

    @Override
    protected void convert(BaseViewHolder helper, Recharge.My_earnings.wallet_list item) {
        int bgColor = helper.getLayoutPosition() % 2;
        helper.setBackgroundResource(R.id.iv_type, qianBg[bgColor]);
        helper.setBackgroundResource(R.id.rv_bg, bgColors[bgColor]);

        helper.setText(R.id.tv_type, item.getWalletName())
                .setText(R.id.tv_money_one, "￥" + item.getBalance());
    }

}
